﻿@model ChangePasswordModel
@using System.Linq
@using System.Reflection
@using XCode
@using XCode.Configuration
@using NewLife.Cube.Entity;
@{
    var requireOldPass = Model.SsoName.IsNullOrEmpty();
}
<div class="row">
    @await Html.PartialAsync("_User_Nav")
</div>
<div class="row">
    <div class="col-md-12">
        <div class="form-horizontal">
            @if (ViewBag.StatusMessage != null)
            {
                <div class="alert alert-success alert-dismissible text-center" role="alert">
                    <button type="button" class="close" data-dismiss="success" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <strong>@ViewBag.StatusMessage</strong>
                </div>
            }
            @using (Html.BeginForm("ChangePassword", "User"))
            {
                <div class="form-group">
                    <label class="control-label col-md-2">名称</label>
                    <div class="input-group col-md-6">
                        <input value="@Model.Name" class="col-xs-12 col-sm-8 col-md-6 col-lg-4" disabled="disabled" />
                        @if (!Model.SsoName.IsNullOrEmpty())
                        {
                            <label>登录自 @Model.SsoName</label>
                        }
                    </div>
                </div>
                @if (requireOldPass)
                {
                    <div class="form-group">
                        <label class="control-label col-md-2">原密码</label>
                        <div class="input-group col-md-6">
                            <input name="OldPassword" type="password" />
                        </div>
                    </div>
                }
                <div class="form-group">
                    <label class="control-label col-md-2">新密码</label>
                    <div class="input-group col-md-6">
                        <input name="NewPassword" type="password" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-md-2">确认密码</label>
                    <div class="input-group col-md-6">
                        <input name="NewPassword2" type="password" />
                    </div>
                </div>
                <div class="clearfix form-actions">
                    <label class="control-label col-md-4"></label>
                    <button type="submit" class="btn btn-success btn-sm"><i class="glyphicon glyphicon-save"></i><strong>保存</strong></button>
                    <button type="button" class="btn btn-danger btn-sm" onclick="history.go(-1);"><i class="glyphicon glyphicon-remove"></i><strong>取消</strong></button>
                </div>
            }
        </div>
    </div>
</div>